﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using PhatPhucLoc.dao;

namespace PhatPhucLoc.view
{
    public partial class FormQuanLyCongNo : Form
    {
        public FormQuanLyCongNo()
        {
            InitializeComponent();
        }

        private void FormQuanLyCongNo_Load(object sender, EventArgs e)
        {
            LoadKH();
        }

        private void LoadKH()
        {
            DataTable dt = KhachHangDAO.KhachHang_GetAll();
            cbbKhachhang.DisplayMember = "ten";
            cbbKhachhang.ValueMember = "id";
            cbbKhachhang.DataSource = dt;
        }

        private void cbbKhachhang_SelectedIndexChanged(object sender, EventArgs e)
        {
            DataTable dt = CongNoDAO.GetByID(cbbKhachhang.SelectedValue.ToString());
            dataGridView1.DataSource = dt;
        }
    }
}
